<?php

ini_set('max_execution_time', 600);
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\ApiController;
use App\Http\Controllers\AiController;
use App\Http\Middleware\ApiAppMiddleware;

Route::get('/', [ApiController::class,'index']);
Route::post('v1/token',[ApiController::class,'token']);
Route::group(['prefix' => 'v1','middleware' => ApiAppMiddleware::class],function (){
    Route::post('/ai/completion',[AiController::class,'completion']);
    Route::get('/ai/completion',[AiController::class,'completion']);
    Route::get('/ai/completions',[AiController::class,'index']);
    Route::get('/info',[ApiController::class,'info']);
});
Route::group(['prefix' => 'v1'],function (){
    Route::post('upload',[ApiController::class,'upload']);
    Route::get('describeFile/{file_id}',[ApiController::class,'DescribeFile']);
});
Route::get('file/{id}',[\App\Http\Controllers\AqController::class,'download'])->name('file.download');

Route::get('device',[\App\Http\Controllers\AqController::class,'device']);
